#include <iostream>
#include <pthread.h>
#include <unistd.h>
#define NUM_THREADS 5
using namespace std;
// 线程运行的函数
void * say_hello(void * args)
{
    cout<<"Hello world"<<endl;
    return 0;
}

int main()
{
    pthread_t pt[NUM_THREADS];
    for(int i=0;i<NUM_THREADS;i++)
    {
        int ret = pthread_create(&pt[i],NULL,say_hello,NULL);
        if(ret!=0)
        {
            cout<<"pthread_create error:error_code = "<<ret<<endl;
        }
    }
    pthread_exit(NULL);
}
